﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FreelanceToolkit.Data.Interfaces;
using FreelanceToolkit.Data;
using FreelanceToolkit.Model;

namespace FreelanceToolkit.Data.Abstract
{
    public class ClientSqlRepository : IClient
    {

        public ClientSqlRepository()
        {

        }

        /// <summary>
        /// Searches the data store for all clients matching the search term
        /// </summary>
        /// <param name="SearchTerm">The search term.</param>
        /// <returns></returns>
        public IQueryable<Client> Search(string SearchTerm)
        {
            PersistanceContext pContext = new PersistanceContext();

            var Clients = from r in pContext.Clients
                          select r;


            return Clients;
        }


        public Client GetSingle(int ClientId)
        {
            PersistanceContext pContext = new PersistanceContext();

            var Client = pContext.Clients.Find(ClientId);

            return Client;

        }


    }
}
